﻿@model ConferenceReviewModel
@{
	ViewBag.Title = Resources.ConferenceReview + ConstValues.strDash + ViewBag.ConferenceName;
}
<div id="menuBar" style="height:35px;">
	<div style="float: left; padding: 5px 5px; font-weight: bold; text-align: left;">
		@Resources.TopicName：<select id="selTopic" class="easyui-combobox" style="height:27px; width:200px;"></select>&nbsp;&nbsp;
		@Resources.ReportType：<select id="selReport" class="easyui-combobox" style="height:27px; width:200px;"></select>&nbsp;&nbsp;
		@Resources.EssayType：<select id="selEssay" class="easyui-combobox" style="height:27px; width:200px;"></select>&nbsp;&nbsp;
		@Resources.ContributionStatus：<select id="selContributionStatus" class="easyui-combobox" style="height:27px; width:200px;" data-options="editable:false, panelHeight:'auto'">
			<option value="">@Resources.All</option>
			<option value="@ConstValues.ContributationStatus.待审">@Resources.StatusReadyToReview</option>
			<option value="@ConstValues.ContributationStatus.审核中">@Resources.StatusReviewing</option>
			<option value="@ConstValues.ContributationStatus.录用">@Resources.StatusReviewAccept</option>
			<option value="@ConstValues.ContributationStatus.不录用">@Resources.StatusReviewReject</option>
		</select>&nbsp;&nbsp;
		@Resources.SendStatus：<select id="selSendStatus" class="easyui-combobox" style="height:27px; width:200px;" data-options="editable:false, panelHeight:'auto'">
			<option value="">@Resources.All</option>
			<option value="@ConstValues.GenericSelectionType.有">@Resources.HasSend</option>
			<option value="@ConstValues.GenericSelectionType.无">@Resources.HasNotSend</option>
		</select>
	</div>
	<div class="clear"></div>
</div>
<div id="menuBar" style="height:35px;">
	<div style="float: left; padding: 5px 5px; font-weight: bold; text-align: left;">
		@Resources.ContributionID/@Resources.FullName/@Resources.Mobile/@Resources.Mail/@Resources.Affiliation：<input id="selIdName" class="easyui-textbox" style="height:27px; width:200px;" />&nbsp;&nbsp;
		@Resources.AllContributions：<select id="selSelfReview" class="easyui-combobox" style="height:27px; width:200px;" data-options="editable:false, panelHeight:'auto'">
			<option value="">@Resources.All</option>
			<option value="@ConstValues.GenericSelectionType.有">@Resources.SelfReview</option>
		</select>&nbsp;&nbsp;
		<a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-search" onclick="searchData();">@Resources.Search</a>
		<a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-export" onclick="exportData();" plain="true">@Resources.Export</a>
	</div>
	<form id="frmExport" method="post" target="iframeExport" action="@Url.Action(nameof(ConferenceReviewController.BatchDownload))">
		@Html.AntiForgeryToken()
		<input type="hidden" id="hdnIds" name="AllId" />
		<input type="hidden" id="hidExtConferenceId" name="conferenceId" />
	</form>
	<iframe id="iframeExport" style="width:0; height:0; visibility:hidden" tabindex="-1"></iframe>
	<div class="clear"></div>
</div>
<div id="dataGrid"></div>

@section bodyParts {
<!-- 初审画面 start -->
<div id="juniorReview" class="easyui-window"
	title="@Resources.JuniorReview" data-options="closed:true,minimizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="firstTrialTitle" class="tit01">@Resources.ContributionInfo</h3>
			<form id="frmJudge" method="post">
				@Html.AntiForgeryToken()
				<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: left;border-bottom:none;" class="c3" colspan="2">
							<input type="hidden" id="hidID" name="Id" />
							<input type="hidden" id="hidConferenceId" name="conferenceId" />
							<input type="hidden" id="hidContributeId" name="contributeId" />
							<span id="contributionId"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							<span id="title"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							<span id="author"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							<span id="affiliation"></span>
						</td>
					</tr>
					@if (Model.Form.IsShowAbstract)
					{
					<tr>
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							@Model.Form.Abstract：<span id="abstract"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowKeyword)
					{
					<tr>
						<td style="text-align: left;border-top:none;" class="c3" colspan="2">
							@Model.Form.Keyword：<span id="keyword"></span>
						</td>
					</tr>
					}
				</table>							
				<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					@if (Model.Form.IsShowTopic)
					{
					<tr>
							<td style="text-align: right; " class="w1 c1">@Model.Form.Topic：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="topicName"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowEssay)
					{
					<tr>
						<td style="text-align: right; " class="w1 c3">@Model.Form.Essay：</td>
						<td style="text-align: left;" class="w10 c4  check_fl" >
							<span id="essayTypeName"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowReport)
					{
					<tr>
						<td style="text-align: right; " class="w1 c1">@Model.Form.Report：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="reportType"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowProgramAbstract)
					{
					<tr>
						<td style="text-align: right; " class="w1 c3">@Model.Form.ProgramAbstract：</td>
						<td style="text-align: left;" class="w10 c4  check_fl" >
							<span id="programAbstract"></span>
						</td>							
					</tr>
					}
					@if (Model.Form.IsShowAbstractFile)
					{
					<tr>
						<td style="text-align: right; " class="w1 c1">@Model.Form.AbstractFile：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="abstractFile"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowSupplementaryFile)
					{
					<tr>
						<td style="text-align: right; " class="w1 c3">@Model.Form.SupplementaryFile：</td>
						<td style="text-align: left;" class="w10 c4  check_fl" >
							<span id="supplementaryFile"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowAwards)
					{
					<tr>
						<td style="text-align: right; " class="w1 c1">@Resources.Awards：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="awards"></span>
						</td>
					</tr>
					}
					<tr>
						<td style="text-align: right; " class="w1 c3">@Resources.Remark：</td>
						<td style="text-align: left;" class="w10 c4  check_fl" >
							<span id="remark"></span>
						</td>
					</tr>
				</table>
				<h3 class="tit01">@Resources.ReviewResult</h3>
				<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: right; " class="w1 c1">Quality：</td>
						<td style="text-align: left;" class="w2 c2  " colspan="3">
							<span id="quality">
								<input type="radio" name="quality" style="height:25px; vertical-align:top;" value="1" />Qutstanding (Paper Award Candidate)&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="radio" name="quality" style="height:25px; vertical-align:top;" value="2" />Significant&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="radio" name="quality" style="height:25px; vertical-align:top;" value="3" />Moderately significant<br />
								<input type="radio" name="quality" style="height:25px; vertical-align:top;" value="4" />Marginal&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="radio" name="quality" style="height:25px; vertical-align:top;" value="5" />Not Significant&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="radio" name="quality" style="height:25px; vertical-align:top;" value="6" />Erroneous or Trivial
							</span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right; " class="w1 c3">Rating：</td>
						<td style="text-align: left;" class="w2 c4  check_fl">
							<span id="evaluation">
								<input type="radio" name="evaluation" value="5"><span>5</span>
								<input type="radio" name="evaluation" value="4"><span>4</span>
								<input type="radio" name="evaluation" value="3"><span>3</span>
								<input type="radio" name="evaluation" value="2"><span>2</span>
								<input type="radio" name="evaluation" value="1"><span>1</span>
							</span>
						</td>
						<td style="text-align: left; " class="w1 c3" colspan="2">
							<input id="txtRemark" name="Remark" class="easyui-textbox" style="height:27px; width:540px;" data-options="validType:['length[1,100]']" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right; " class="w1 c1">Recommendation：</td>
						<td style="text-align: left;" class="w2 c2  check_fl">
							<span id="result">
								<input type="radio" name="result" value="@ConstValues.ContributationStatus.录用"><span>Accept</span>
								<input type="radio" name="result" value="@ConstValues.ContributationStatus.不录用"><span>Reject</span>											
							</span>
						</td>
						<td style="text-align: right;" class="w6 c1 check_fl" colspan="2">
							<input type="radio" name="result" value="@ConstValues.ContributationStatus.转投"><span style="margin-right:20px;">Transfer</span>
							<input id="ddlReportType" name="topicName" class="easyui-combobox" style="height:27px; width:300px;">
						</td>
					</tr>
					<tr>
						<td style="text-align: right; " class="w1 c3">Presentation Type：</td>
						<td style="text-align: left;" class="w2 c4 " colspan="3">
							Transfer&nbsp;&nbsp;&nbsp;<input id="ddlPresentationType" name="reportType" class="easyui-combobox" style="height:27px; width:200px;" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right; " class="w1 c1">Advantage：</td>
						<td style="text-align: left;" class="w2 c2" colspan="3">
							<input id="advantage" name="advantage" class="easyui-textbox" style="height:50px; width:892px;" data-options="multiline:true" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right; " class="w1 c3">Defect：</td>
						<td style="text-align: left;" class="w2 c4" colspan="3">
							<input id="defect" name="defect" class="easyui-textbox" style="height:50px; width:892px;" data-options="multiline:true" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right; " class="w1 c1">Other（Invisible to Authors）：</td>
						<td style="text-align: left;" class="w2 c2" colspan="3">
							<input id="others" name="others" class="easyui-textbox" style="height:50px; width:892px;" data-options="multiline:true" />
						</td>
					</tr>
				</table>
			</form>
			<div class="btnDiv">
				<input type="hidden" id="hdnWindowType" />
				<input type="hidden" id="hdnTopicType" />
				<input type="button" class="gbtn" onclick="saveJunior();" value="@Resources.Save" />&nbsp;&nbsp;
				<input type="button" class="rbtn" onclick="$('#juniorReview').window('close');" value="@Resources.Cancel" />
			</div>
		</div>
	</div>
</div>
<!-- 初审画面 end -->
<!-- 终审画面 start -->
<div id="finalReview" class="easyui-window"
	title="@Resources.FinalReview" data-options="closed:true,minimizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="finalTrialTitle" class="tit01">@Resources.Lookup</h3>
			<form id="finalJudge" method="post">
				@Html.AntiForgeryToken()
				<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: left;border-bottom:none;" class="c3" colspan="2">
							<input type="hidden" id="f-hidID" name="Id" />
							<input type="hidden" id="f-hidConferenceId" name="conferenceId" />
							<input type="hidden" id="f-hidContributeId" name="contributeId" />
							<span id="f-contributionId"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							<span id="f-title"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							<span id="f-author"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							<span id="f-affiliation"></span>
						</td>
					</tr>
					@if (Model.Form.IsShowAbstract)
					{
					<tr>
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							@Model.Form.Abstract：<span id="f-abstract"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowKeyword)
					{
					<tr>
						<td style="text-align: left;border-top:none;" class="c3" colspan="2">
							@Model.Form.Keyword：<span id="f-keyword"></span>
						</td>
					</tr>
					}
				</table>
				<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">								
					@if (Model.Form.IsShowTopic)
					{
					<tr>
						<td style="text-align: right; " class="w1 c1">@Model.Form.Topic：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="f-topicName"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowEssay)
					{
					<tr>
						<td style="text-align: right; " class="w1 c3">@Model.Form.Essay：</td>
						<td style="text-align: left;" class="w10 c4  check_fl" >
							<span id="f-essayTypeName"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowReport)
					{
					<tr>
						<td style="text-align: right; " class="w1 c1">@Model.Form.Report：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="f-reportType"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowProgramAbstract)
					{
					<tr>
						<td style="text-align: right; " class="w1 c3">@Model.Form.ProgramAbstract：</td>
						<td style="text-align: left;" class="w10 c4  check_fl" >
							<span id="f-programAbstract"></span>
						</td>								
					</tr>
					}
					@if (Model.Form.IsShowAbstractFile)
					{
					<tr>
						<td style="text-align: right; " class="w1 c1">@Model.Form.AbstractFile：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="f-abstractFile"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowSupplementaryFile)
					{
					<tr>
						<td style="text-align: right; " class="w1 c3">@Model.Form.SupplementaryFile：</td>
						<td style="text-align: left;" class="w10 c4  check_fl" >
							<span id="f-supplementaryFile"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowAwards)
					{
					<tr>
						<td style="text-align: right; " class="w1 c1">@Resources.Awards：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="f-awards"></span>
						</td>
					</tr>
					}
					<tr>
						<td style="text-align: right; " class="w1 c3">@Resources.Remark：</td>
						<td style="text-align: left;" class="w10 c4  check_fl" >
							<span id="f-remark"></span>
						</td>
					</tr>
				</table>
				<h3 class="tit01">@Resources.ReviewResult</h3>
				<div id="review_result" style="width:100%"></div>
				<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: right; " class="w1 c3">@Resources.SystemReviewResult：</td>
						<td style="text-align: left;" class="w10 c4">
							<div id="sysReviewResult"></div>
						</td>
					</tr>
					<tr>
						<td style="text-align: right; " class="w1 c1">@Resources.FinalReview：</td>
						<td style="text-align: left;" class="w10 c2 check_fl">
							<span id="finalResult">
								<input type="radio" name="finalResult" value="@ConstValues.ContributationStatus.录用"><span>Accept</span>
								<input type="radio" name="finalResult" value="@ConstValues.ContributationStatus.不录用"><span>Reject</span>
							</span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right; " class="w1 c3">@Resources.FinalReview@Resources.ReviewerComment：</td>
						<td style="text-align: left;" class="w10 c4">
							<input id="txtAdvantage" name="Advantage" class="easyui-textbox" style="height:50px; width:88%;" data-options="multiline:true,validType:['length[1,1000]']" />
						</td>
					</tr>
				</table>
			</form>
			<div class="btnDiv">
				<input type="hidden" id="f-hdnWindowType" />
				<input type="button" class="gbtn" onclick="saveFinal();" value="@Resources.Save" />&nbsp;&nbsp;
				<input type="button" class="rbtn" onclick="$('#finalReview').window('close');" value="@Resources.Cancel" />
			</div>
		</div>
	</div>
</div>
<!-- 终审画面 end -->
<!-- 查看画面 start -->
<div id="lookupReview" class="easyui-window"
	title="@Resources.CheckProfileContributeInfo" data-options="closed:true,minimizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="finalTrialTitle" class="tit01">@Resources.Lookup</h3>
			<form id="lookupJudge" method="post">
				@Html.AntiForgeryToken()
				<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							<input type="hidden" id="l-hidID" name="Id" />
							<input type="hidden" id="l-hidConferenceId" name="conferenceId" />
							<input type="hidden" id="l-hidContributeId" name="contributeId" />
							<input type="hidden" id="l-hasPdf" name="hasPdf" />
							<span id="l-contributionId"></span>
						</td>
					</tr>
					<tr>	
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							<span id="l-title"></span>
						</td>
					</tr>
					<tr>	
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							<span id="l-author"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							<span id="l-affiliation"></span>
						</td>
					</tr>
					@if (Model.Form.IsShowAbstract)
					{
					<tr>
						<td style="text-align: left;border-bottom:none;border-top:none;" class="c3" colspan="2">
							@Model.Form.Abstract：<span id="l-abstract"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowKeyword)
					{
					<tr>
						<td style="text-align: left;border-top:none;" class="c3" colspan="2">
							@Model.Form.Keyword：<span id="l-keyword"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowTopic)
					{
					<tr>
						<td style="text-align: right;" class="w1 c1">@Model.Form.Topic：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="l-topicName"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowEssay)
					{
					<tr>
						<td style="text-align: right;" class="w1 c3">@Model.Form.Essay：</td>
						<td style="text-align: left;" class="w10 c4">
							<span id="l-essayTypeName"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowReport)
					{
					<tr>
						<td style="text-align: right;" class="w1 c1">@Model.Form.Report：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="l-reportType"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowProgramAbstract)
					{
					<tr>
						<td style="text-align: right;" class="w1 c3">@Model.Form.ProgramAbstract：</td>
						<td style="text-align: left;" class="w10 c4">
							<span id="l-programAbstract"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowAbstractFile)
					{
					<tr>
						<td style="text-align: right;" class="w1 c1">@Model.Form.AbstractFile：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="l-abstractFile"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowSupplementaryFile)
					{
					<tr>
						<td style="text-align: right;" class="w1 c3">@Model.Form.SupplementaryFile：</td>
						<td style="text-align: left;" class="w10 c4">
							<span id="l-supplementaryFile"></span>
						</td>
					</tr>
					}
					@if (Model.Form.IsShowAwards)
					{
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.Awards：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="l-awards"></span>
						</td>
					</tr>
					}
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.Remark：</td>
						<td style="text-align: left;" class="w10 c4">
							<span id="l-remark"></span>
						</td>
					</tr>
				</table>
				<h3 class="tit01">@Resources.ReviewResult</h3>
				<div id="l-review_result" style="width:100%"></div>
				<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: right; " class="w1 c1">@Resources.SystemReviewResult：</td>
						<td style="text-align: left;" class="w10 c2">
							<div id="l-sysReviewResult"></div>
						</td>
					</tr>
					<tr>
						<td style="text-align: right; " class="w1 c3">@Resources.FinalReview：</td>
						<td style="text-align: left;" class="w10 c4 check_fl">
							<div id="l-finalReviewResult"></div>
						</td>
					</tr>
					@if (Model.IsReview) {
					<tr>
						<td style="text-align: right; " class="w1 c1">@Resources.FinalReview@Resources.ReviewerComment：</td>
						<td style="text-align: left;" class="w10 c2">
							<div id="l-finalRemark"></div>
						</td>
					</tr>
					}
				</table>
			</form>
			<div class="btnDiv">
				<input type="hidden" id="l-hdnWindowType" />
				<input type="button" class="rbtn" onclick="$('#lookupReview').window('close');" value="@Resources.Close" />
			</div>
		</div>
	</div>
</div>
<!-- 查看画面 end -->
<!-- 查看所有作者画面 start -->
<div id="authorWindow" class="easyui-window"
	title="@Resources.Author" data-options="closed:true,minimizable:false,maximizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="authorWindowTitle" class="tit01">@Resources.Check</h3>
			<div id="authorDG"></div>
		</div>
	</div>
</div>
<!-- 查看所有作者画面 end -->
<!-- 发送PDF确认画面 start -->
<div id="sendWindow" class="easyui-window"
	title="@Resources.Send" data-options="closed:true,minimizable:false,maximizable:false,iconCls:'icon-save'"
	style="width:600px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="detailWindowTitle" class="tit01">@Resources.CfmSendReviewResult</h3>
			<div class="btnDiv">
				<input type="hidden" id="sendId">
				<input type="hidden" id="sendContributeId">
				<input type="hidden" id="sendConferenceId">
				<input type="button" class="lbtn" onclick="send(false);" value="@Resources.OnlySendResult" />&nbsp;&nbsp;
				<input type="button" class="gbtn" onclick="send(true);" value="@Resources.SendResultAndPdf" />&nbsp;&nbsp;
				<input type="button" class="rbtn" onclick="$('#sendWindow').window('close');" value="@Resources.Cancel" />
			</div>
		</div>
	</div>
</div>
<!-- 发送PDF确认画面 start -->
<!-- 管理员修改画面 start-->
<div id="adminWindow" class="easyui-window"
	title="@Resources.Modify@Resources.ReviewResult" data-options="closed:true,minimizable:false,iconCls:'icon-save'"
	style="width:600px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<form id="frmAdmin" method="post">
				@Html.AntiForgeryToken()
				<table width="100%" height="100%" id="tblAdmin" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.ReviewerResult：</td>
						<td style="text-align: left;" class="w2 c2">
							<input type="hidden" id="hidAdminContributeId" name="ContributeId" />
							<span id="reviewerResult"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.AdminResult：</td>
						<td style="text-align: left;" class="w2 c4">
							<select id="ddlAdminResult" name="AdminStatus" class="easyui-combobox" style="height:27px; width:300px;" data-options="editable:false,required:true,panelHeight:'auto'">
								<option value="@ConstValues.ContributationStatus.录用">@Resources.StatusReviewAccept</option>
								<option value="@ConstValues.ContributationStatus.不录用">@Resources.StatusReviewReject</option>
							</select>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.Remark：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="txtAdminRemark" name="AdminRemark" class="easyui-textbox" style="height:100px; width:300px;" data-options="multiline:true, validType:['length[1,1000]']" />
						</td>
					</tr>
				</table>
			</form>
			<div class="btnDiv">
				<input type="button" class="gbtn" onclick="saveAdmin();" value="@Resources.Save" />&nbsp;&nbsp;
				<input type="button" class="rbtn" onclick="$('#adminWindow').window('close');" value="@Resources.Cancel" />
			</div>
		</div>
	</div>
</div>
<!-- 管理员修改画面 end-->
}

@section Scripts {
<script>
	common.setCurrentMenu("ConferenceReview");
	common.setCurrentParentMenu("#menu_a3");

	$(function () {
		$("#hidConferenceId").val("@Model.ConferenceId");
		$("#hidExtConferenceId").val("@Model.ConferenceId");

		$("#selIdName").textbox("textbox").bind("keydown", function (e) {
			if (e.keyCode == 13) {
				searchData()
			}
		});

		var selTopic = 0;
		$("#selTopic").combobox({
			editable: false,
			valueField: "id",
			textField: "name",
			url: "@Url.Action(nameof(UtilityController.GetTopicWithAll),
					nameof(UtilityController).GetControllerName())" + "?conferenceId=" + $("#hidConferenceId").val(),
			onLoadSuccess: function(data) {
				selTopic = data.length;
			},
			onShowPanel: function () {
				if (selTopic < 10) {
					$(this).combobox("panel").height("auto");
				} else {
					$(this).combobox("panel").height(200);
				}
			},
		});

		var selReport = 0;
		$("#selReport").combobox({
			editable: false,
			valueField: "id",
			textField: "name",
			url: "@Url.Action(nameof(UtilityController.GetReportWithAll),
					nameof(UtilityController).GetControllerName())" + "?conferenceId=" + $("#hidConferenceId").val(),
			onLoadSuccess: function(data) {
				selReport = data.length;
			},
			onShowPanel: function () {
				if (selReport < 10) {
					$(this).combobox("panel").height("auto");
				} else {
					$(this).combobox("panel").height(200);
				}
			},
		});

		var selEssay = 0;
		$("#selEssay").combobox({
			editable: false,
			valueField: "id",
			textField: "name",
			url: "@Url.Action(nameof(UtilityController.GetEssayWithAll),
					nameof(UtilityController).GetControllerName())" + "?conferenceId=" + $("#hidConferenceId").val(),
			onLoadSuccess: function(data) {
				selEssay = data.length;
			},
			onShowPanel: function () {
				if (selEssay < 10) {
					$(this).combobox("panel").height("auto");
				} else {
					$(this).combobox("panel").height(200);
				}
			},
		});

		$("#dataGrid").datagrid({
			url: "@Url.Action(nameof(ConferenceReviewController.GetData),
					nameof(ConferenceReviewController).GetControllerName())",
			method: "get",
			checkOnSelect: false,
			//singleSelect: true,
			fitColumns: true,
			width: $(window).width() - 285,
			height: $(window).height() - 158 - 38,
			nowrap: false,
			pagination: true,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			toolbar: "#toolBar",
			pageSize: 100,
			pageList: [100, 200, 300, 400, 500],
			frozenColumns: [[
					{ field: "chk", align: "center", checkbox: true },
					{ field: "id", title: "ID", hidden: true },
					{ field: "conferenceId", title: "ConferenceId", hidden:true },
					{
						field: "operate", title: "@Resources.Operate", align: "center", width: 200,
						formatter: function(value, rec) {
							var strInfo = "";
							if ("@Model.AllowToReview" == "True") {
								if (rec.userIdList.indexOf("@Model.UserId") != -1) {
									if (rec.contributationStatus != "@ConstValues.ContributationStatus.录用" && rec.contributationStatus != "@ConstValues.ContributationStatus.不录用") {
										if ("@Model.IsReview" == "False") {
											strInfo += "<a href='#' style='color:#66CDAA;font-weight:bold;text-decoration:underline;' onclick='juniorReview(\""
												+ rec.contributeId + "\")'>@Resources.JuniorReview</a>";
										} else {
											if ("@Model.IsFirstReviewer" == "True") {
												strInfo += "<a href='#' style='color:#66CDAA;font-weight:bold;text-decoration:underline;' onclick='juniorReview(\""
													+ rec.contributeId + "\")'>@Resources.JuniorReview</a>";
											}
											if ("@Model.IsFinalReviewer" == "True") {
												if (strInfo != "") {
													strInfo += "&nbsp;|&nbsp;";
												}
												strInfo += "<a href='#' style='color:#FF8C00;font-weight:bold;text-decoration:underline;' onclick='finalReview(\""
													+ rec.contributeId + "\")'>@Resources.FinalReview</a>";
											}
										}
									}
								}
								@if ((User as ICISPrincipal).IsSSA || (User as ICISPrincipal).CSAList.Contains(Model.ConferenceId))
					 			{
									<text>
								if (rec.contributationStatus != "@ConstValues.ContributationStatus.待审" && rec.contributationStatus != "@ConstValues.ContributationStatus.审核中") {
									if (strInfo != "") {
										strInfo += "&nbsp;|&nbsp;";
									}
									strInfo += "<a href='#' style='color:#DC143C;font-weight:bold;text-decoration:underline;' onclick='sendConfirm(\""
										+ rec.id + "\",\"" + rec.contributeId + "\",\"" + rec.conferenceId + "\")'>@Resources.Send</a>";
								}
								</text>
					 			}
							}
							if (strInfo != "") {
								strInfo += "&nbsp;|&nbsp;";
							}
							strInfo += "<a href='#' style='color:#1874CD;font-weight:bold;text-decoration:underline;' onclick='lookupReview(\""
									+ rec.contributeId + "\")'>@Resources.Lookup</a>";

							@if ((User as ICISPrincipal).IsSSA || (User as ICISPrincipal).CSAList.Contains(Model.ConferenceId))
							{
								<text>
							if (rec.contributationStatus != "@ConstValues.ContributationStatus.待审" && rec.contributationStatus != "@ConstValues.ContributationStatus.审核中") {
								strInfo += "&nbsp;|&nbsp;";
								strInfo += "<a href='#' style='color:#66CDAA;font-weight:bold;text-decoration:underline;' onclick='openAdmin(\""
									+ rec.contributeId + "\",\"" + rec.contributationStatus + "\",\""
									+ rec.adminStatus + "\",\"" + rec.adminRemark + "\")'>@Resources.Modify@Resources.ReviewResult</a>";
							}
							</text>
							}
							return strInfo;
						}
					},
				{ field: "contributeId", title: "@Resources.ContributionID", align: "center", sortable: true, width: 150 },
				{ field: "essayTitle", title: "@Resources.ContributionTitle", align: "center", sortable: true, width: 200 },
				{
					field: "author", title: "@Resources.Author", align: "center", width: 100,
					formatter: function(value, rec) {
						var strInfo = "<a href='#' style='color:#FF8C00;font-weight:bold;text-decoration:underline;' onclick='openAuthor(\""
							+ rec.contributeId + "\")'>@Resources.Check</a>";
						return strInfo;
					}
				},
			]],
			columns: [[
				{
					field: "contributationStatus", title: "@Resources.ContributionStatus", align: "center", sortable: true, width: 100,
					formatter: function(value,rec) {
						if (rec.adminStatus == "@ConstValues.ContributationStatus.录用") {
							return "@Resources.StatusReviewAccept";
						} else if (rec.adminStatus == "@ConstValues.ContributationStatus.不录用") {
							return "@Resources.StatusReviewReject";
						} else if (rec.contributationStatus == "@ConstValues.ContributationStatus.录用") {
							return "@Resources.StatusReviewAccept";
						} else if (rec.contributationStatus == "@ConstValues.ContributationStatus.不录用") {
							return "@Resources.StatusReviewReject";
						} else if (rec.contributationStatus == "@ConstValues.ContributationStatus.待审") {
							return "@Resources.StatusReadyToReview";
						} else if (rec.contributationStatus == "@ConstValues.ContributationStatus.审核中") {
							return "@Resources.StatusReviewing";
						}
					},
					styler: function(index,rec){
						if (rec.adminStatus != null) {
							return "font-weight:bold;color:#DC143C;";
						}
					}
				},
				{
					field: "hasSend", title: "@Resources.SendStatus", align: "center", sortable: true, width: 100,
					formatter: function(value,rec) {
						if (value == true) {
							return "@Resources.HasSend";
						} else {
							return "@Resources.HasNotSend";
						}
					}
				},
				{ field: "fullName", title: "@Resources.TheFirstAuthor", align: "center", width: 150 },
				{ field: "affiliation", title: "@Resources.TheFirstAuthorCompany", align: "center", width: 200 },
				{ field: "topicName", title: "@Resources.TopicName", align: "center", sortable: true, width: 150 },
				{ field: "essayType", title: "@Resources.EssayType", align: "center", sortable: true, width: 150 },
				{ field: "reportType", title: "@Resources.ReportType", align: "center", sortable: true, width: 150 }
			]],
			onBeforeLoad: function (param) {
				param.conferenceId = $("#hidConferenceId").val();
				param.random = Math.random();
			},
			onLoadSuccess: function(data) {
				var exportIdList = $("#hdnIds").val();
				if (data.rows.length > 0) {
					var exportIdArray = exportIdList.split(',');
					for (var rowIndex = 0; rowIndex < data.rows.length; rowIndex++) {
						for (var index = 0; index < exportIdArray.length; index++) {
							if (data.rows[rowIndex].contributeId == exportIdArray[index]) {
								$("input[type='checkbox']").eq(rowIndex + 1).prop("checked", true);
								break;
							}
						}
					}
				}
			},
			onCheck: function (rowIndex, rowData) {
				var exportIdList = $("#hdnIds").val();
				var strId = rowData.contributeId.toString();
				if (exportIdList == "") {
					$("#hdnIds").val(strId);
				} else {
					var exportIdArray = exportIdList.split(',');
					var newArray = exportIdArray.concat(strId);
					$("#hdnIds").val(newArray.join());
				}
			},
			onUncheck: function (rowIndex, rowData) {
				var exportIdList = $("#hdnIds").val();
				var exportIdArray = exportIdList.split(',');
				var strId = rowData.contributeId.toString();
				exportIdArray.remove(strId);
				$("#hdnIds").val(exportIdArray.join());
			},
			onCheckAll: function (rows) {
				var exportIdList = $("#hdnIds").val();
				if (exportIdList == "") {
					var newArray = new Array();
					for (var index = 0; index < rows.length; index++) {
						var strId = rows[index].contributeId.toString();
						newArray = newArray.concat(strId);
					}
					$("#hdnIds").val(newArray.join());
				} else {
					var exportIdArray = exportIdList.split(',');
					var newArray = exportIdArray;
					for (var index = 0; index < rows.length; index++) {
						var strId = rows[index].contributeId.toString();
						if (newArray.indexOf(strId) < 0) {
							newArray = newArray.concat(strId);
						}
					}
					$("#hdnIds").val(newArray.join());
				}
			},
			onUncheckAll: function (rows) {
				var exportIdList = $("#hdnIds").val();
				var exportIdArray = exportIdList.split(',');
				for (var index = 0; index < rows.length; index++) {
					var strId = rows[index].contributeId.toString();
					exportIdArray.remove(strId);
				}
				$("#hdnIds").val(exportIdArray.join());
			},
		});

		$(window).resize(function () {
			$("#dataGrid").datagrid("resize", {
				width: $(window).width() - 285,
				height: $(window).height() - 158 - 38
			});
		});

		$("#juniorReview").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			height: 800,
			top: 100
		});

		$("#finalReview").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			height: 800,
			top: 100
		});

		$("#authorWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			top: ($(window).height() - 600) * 0.5
		});

		$("#lookupReview").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			height: 800,
			top: 100
		});

		$("#adminWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			top: ($(window).height() - 600) * 0.5
		});
	});

	function juniorReview(id){
		$("#abstractFile").html("");
		$("#supplementaryFile").html("");
		$("#txtRemark").textbox("setValue", "");

		$("span[id='contributionId']").html("");
		$("span[id='title']").html("");
		$("span[id='author']").html("");
		$("span[id='affiliation']").html("");
		$("span[id='abstract']").html("");
		$("span[id='keyword']").html("");
		$("span[id='topicName']").html("");
		$("span[id='essayTypeName']").html("");
		$("span[id='reportType']").html("");
		$("span[id='programAbstract']").html("");
		$("span[id='awards']").html("");
		$("span[id='remark']").html("");

		var url = "@Url.Action(nameof(UtilityController.GetContributeInfo),
				nameof(UtilityController).GetControllerName())" + "/" + id;
		$.get(url, null, function (data, textStatus, jqXHR) {
			if (data.result == "@ConstValues.AjaxFailResult") {
				common.showError(data.message);
				$("#dataGrid").datagrid("reload");
			} else {
				$("#hdnWindowType").val("junior");
				$("#hidID").val(id);
				$("#hidContributeId").val(data.data.contributeId);
				$("#hdnTopicType").val(data.data.topicId);

				$("span[id='contributionId']").html(data.data.contributeId);
				$("span[id='title']").html(data.data.essayTitle);
				$("span[id='author']").html(data.data.author);
				$("span[id='affiliation']").html(data.data.affiliation);
				var abs = "";
				if (data.data.abstract != null) {
					var reg = new RegExp("<p>","g");
					var reg2 = new RegExp("</p>","g");
					abs = data.data.abstract.replace(reg,"");
					abs = abs.replace(reg2,"");
				}
				$("span[id='abstract']").html(abs);
				$("span[id='keyword']").html(data.data.keyword);
				$("span[id='topicName']").html(data.data.topicName);
				$("span[id='essayTypeName']").html(data.data.essayTypeName);
				$("span[id='reportType']").html(data.data.reportType);
				$("span[id='programAbstract']").html(data.data.programAbstract);
				$("span[id='awards']").html(data.data.awards);
				$("span[id='remark']").html(data.data.remark);

				if (data.data.abstractFile != null) {
					if (/\.(pdf|PDF)$/.test(data.data.abstractFile)) {
						$("#abstractFile").append('<a class="downloadLink" href="'+data.data.abstractFilePath+'" target="_blank">'+data.data.abstractFile+'</a>');
					} else {
						$("#abstractFile").append('<a class="downloadLink" href="@Url.Action(nameof(UtilityController.DownloadContributeFile),
								nameof(UtilityController).GetControllerName())/'+data.data.contributeId+'/@ConstValues.FileType.Abstract">'+data.data.abstractFile+'</a>');
					}
				}
				if (data.data.supplementaryFile != null) {
					if (/\.(pdf|PDF)$/.test(data.data.supplementaryFile)) {
						$("#supplementaryFile").append('<a class="downloadLink" href="'+data.data.supplementaryFilePath +'" target="_blank">'+data.data.supplementaryFile+'</a>');
					} else {
						$("#supplementaryFile").append('<a class="downloadLink" href="@Url.Action(nameof(UtilityController.DownloadContributeFile),
								nameof(UtilityController).GetControllerName())/'+data.data.contributeId+'/@ConstValues.FileType.Supplementary">'+data.data.supplementaryFile+'</a>');
					}
				}

				var orgCount = 0;
				$("#ddlReportType").combobox({
					editable: false,
					required: false,
					valueField: "id",
					textField: "name",
					url: "@Url.Action(nameof(UtilityController.GetTopic),
							nameof(UtilityController).GetControllerName())"+"?conferenceId="+ "@Model.ConferenceId",
					onShowPanel: function () {
						if (orgCount < 10) {
							$(this).combobox("panel").height("auto");
						} else {
							$(this).combobox("panel").height(200);
						}
					},
				});

				$("#ddlReportType").combobox("setValue",data.data.topicId);

				//报告类型 -- 新增
				$("#ddlPresentationType").combobox({
					editable: false,
					required: false,
					valueField: "id",
					textField: "name",
					url: "@Url.Action(nameof(UtilityController.GetReport),
							nameof(UtilityController).GetControllerName())"+"?conferenceId="+ "@Model.ConferenceId",
					onShowPanel: function () {
						if (orgCount < 10) {
							$(this).combobox("panel").height("auto");
						} else {
							$(this).combobox("panel").height(200);
						}
					},
				});

				$("#ddlPresentationType").combobox("setValue",data.data.reportId);

				url = "@Url.Action(nameof(ConferenceReviewController.GetJuniorEditData),
						nameof(ConferenceReviewController).GetControllerName())?id="+ id + "&conferenceId=@Model.ConferenceId";
				$.get(url, null, function (data, textStatus, jqXHR) {
					if (data.result == "@ConstValues.AjaxFailResult") {
						common.showError(data.message);
						$("#dataGrid").datagrid("reload");
					} else {
						$("#advantage").textbox("setValue","");
						$("#defect").textbox("setValue","");
						$("#others").textbox("setValue","");

						$("input[name=quality]").attr("checked",false);
						$("input[name=evaluation]").attr("checked",false);
						$("input[name=result]").attr("checked",false);
						if (data.data.quality != 0) {
							$("input[name='quality'][value="+ data.data.quality +"]")[0].checked=true;
						}
						if (data.data.evaluation != 0) {
							$("input[name='evaluation'][value="+ data.data.evaluation +"]")[0].checked=true;
						}
						if (data.data.result != "@ConstValues.ContributationStatus.待审" && data.data.result != "@ConstValues.ContributationStatus.审核中") {
							$("input[name='result'][value="+ data.data.result +"]")[0].checked=true;
						}

						$("#txtRemark").textbox("setValue",data.data.remark);
						$("#advantage").textbox("setValue",data.data.advantage);
						$("#defect").textbox("setValue",data.data.defect);
						$("#others").textbox("setValue",data.data.others);
					}
				});
			}
		});

		$("#juniorReview").window("open");
	};

	function saveJunior() {
		var quality = $("input[name='quality']:checked").val();
		var evaluation = $("input[name='evaluation']:checked").val();
		var result = $("input[name='result']:checked").val();

		if (result == null) {
			common.showError("@Resources.MsgReviewResultError");
			return;
		}

		//报告类型：转投
		if (result == "@ConstValues.ContributationStatus.转投") {
			var otherSession = $("#ddlReportType").combobox("getValue");
			if (otherSession == null || otherSession == "" || otherSession == $("#hdnTopicType").val()) {
				common.showError("@Resources.MsgReviewTopicType");
				return;
			}
		}

		var otherReport = $("#ddlPresentationType").combobox("getValue");
		if (otherReport == null || otherReport == "") {
			common.showError("@Resources.MsgReviewReportType");
			return;
		}

		$.messager.confirm("@Resources.Save", "@Resources.CfmSave", function (r) {
			if (r) {
				var loading = layer.load(0,  {
					shade: [0.4,"#fff"]
				});
				$.post("@Url.Action(nameof(ConferenceReviewController.JuniorReview),
						nameof(ConferenceReviewController).GetControllerName())",
					$("#frmJudge").serialize(),
					function(data, textStatus, jqXHR) {
						layer.close(loading);
						if (data.result == "@ConstValues.AjaxFailResult") {
							common.showError(data.message);
						} else {
							common.showSuccess(data.message, true);
							$("#juniorReview").window("close");
							$("#dataGrid").datagrid("reload");
						}
					}
				);
			}
		});
	};

	function finalReview(id) {
		$("#review_result").html("");
		$("#sysReviewResult").html("");
		$("#f-abstractFile").html("");
		$("#f-supplementaryFile").html("");
		$("#txtAdvantage").textbox("setValue", "");

		$("span[id='f-contributionId']").html("");
		$("span[id='f-title']").html("");
		$("span[id='f-author']").html("");
		$("span[id='f-affiliation']").html("");
		$("span[id='f-abstract']").html("");
		$("span[id='f-keyword']").html("");
		$("span[id='f-topicName']").html("");
		$("span[id='f-essayTypeName']").html("");
		$("span[id='f-reportType']").html("");
		$("span[id='f-programAbstract']").html("");
		$("span[id='f-awards']").html("");
		$("span[id='f-remark']").html("");

		var url = "@Url.Action(nameof(UtilityController.GetContributeInfo),
				nameof(UtilityController).GetControllerName())" + "/" + id;
		$.get(url, null, function (data, textStatus, jqXHR) {
			if (data.result == "@ConstValues.AjaxFailResult") {
				common.showError(data.message);
			} else {
				$("#f-hdnWindowType").val("final");
				$("#f-hidID").val(id);
				$("#f-hidContributeId").val(data.data.contributeId);
				$("#f-hidConferenceId").val("@Model.ConferenceId");

				$("span[id='f-contributionId']").html(data.data.contributeId);
				$("span[id='f-title']").html(data.data.essayTitle);
				$("span[id='f-author']").html(data.data.author);
				$("span[id='f-affiliation']").html(data.data.affiliation);
				var abs = "";
				if (data.data.abstract != null) {
					var reg = new RegExp("<p>","g");
					var reg2 = new RegExp("</p>","g");
					abs = data.data.abstract.replace(reg,"");
					abs = abs.replace(reg2,"");
				}
				$("span[id='f-abstract']").html(abs);
				$("span[id='f-keyword']").html(data.data.keyword);
				$("span[id='f-topicName']").html(data.data.topicName);
				$("span[id='f-essayTypeName']").html(data.data.essayTypeName);
				$("span[id='f-reportType']").html(data.data.reportType);
				$("span[id='f-programAbstract']").html(data.data.programAbstract);
				$("span[id='f-awards']").html(data.data.awards);
				$("span[id='f-remark']").html(data.data.remark);

				if (data.data.abstractFile != null) {
					if (/\.(pdf|PDF)$/.test(data.data.abstractFile)) {
						$("#f-abstractFile").append('<a class="downloadLink" href="'+data.data.abstractFilePath+'" target="_blank">'+data.data.abstractFile+'</a>');
					} else {
						$("#f-abstractFile").append('<a class="downloadLink" href="@Url.Action(nameof(UtilityController.DownloadContributeFile),
								nameof(UtilityController).GetControllerName())/'+data.data.contributeId+'/@ConstValues.FileType.Abstract">'+data.data.abstractFile+'</a>');
					}
				}
				if (data.data.supplementaryFile != null) {
					if (/\.(pdf|PDF)$/.test(data.data.supplementaryFile)) {
						$("#f-supplementaryFile").append('<a class="downloadLink" href="'+data.data.supplementaryFilePath+'" target="_blank">'+data.data.supplementaryFile+'</a>');
					} else {
						$("#f-supplementaryFile").append('<a class="downloadLink" href="@Url.Action(nameof(UtilityController.DownloadContributeFile),
								nameof(UtilityController).GetControllerName())/'+data.data.contributeId+'/@ConstValues.FileType.Supplementary">'+data.data.supplementaryFile+'</a>');
					}
				}

				$("#sysReviewResult").append("@Resources.StatusReadyToReview");
				var urlr = "@Url.Action(nameof(UtilityController.GetJuniorResult),
						nameof(UtilityController).GetControllerName())?id="+ id + "&userId=@((User as ICISPrincipal).UserID)";
				$.get(urlr, null, function (data, textStatus, jqXHR) {
					if (data.length > 0) {
						var AcceptCount = 0;
						var RejectCount = 0;
						for (var index = 0; index < data.length; index++) {
							var quality = "";
							if (data[index].quality == 1) {
								quality = "@ConstValues.ReviewQuality.One";
							} else if (data[index].quality == 2) {
								quality = "@ConstValues.ReviewQuality.Two";
							} else if (data[index].quality == 3) {
								quality = "@ConstValues.ReviewQuality.Three";
							} else if (data[index].quality == 4) {
								quality = "@ConstValues.ReviewQuality.Four";
							} else if (data[index].quality == 5) {
								quality = "@ConstValues.ReviewQuality.Five";
							} else if (data[index].quality == 6) {
								quality = "@ConstValues.ReviewQuality.Six";
							}

							var contributationStatus = "";
							if (data[index].result == "@ConstValues.ContributationStatus.待审") {
								contributationStatus += "@Resources.StatusReadyToReview";
							} else if (data[index].result == "@ConstValues.ContributationStatus.录用") {
								contributationStatus += "@Resources.StatusReviewAccept";
							} else if (data[index].result == "@ConstValues.ContributationStatus.不录用") {
								contributationStatus += "@Resources.StatusReviewReject";
							} else if (data[index].result == "@ConstValues.ContributationStatus.审核中") {
								contributationStatus += "@Resources.StatusReviewing";
							}

							var html = '<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c1">@Resources.ReviewId：</td>'
								+	'<td style="text-align: left;" class="w10 c2">'
								+		''+ data[index].userName +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c3">Quailty：</td>'
								+	'<td style="text-align: left;" class="w10 c4">'
								+		''+ (quality != 0 ? quality  : "") +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c1">Rating：</td>'
								+	'<td style="text-align: left;" class="w10 c2">'
								+		''+ (data[index].evaluation != 0 ? data[index].evaluation : "") +' '+data[index].remark +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c3">Recommendation：</td>'
								+	'<td style="text-align: left;" class="w10 c4">' + contributationStatus
								+ 	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c1">@Resources.Advantage：</td>'
								+	'<td style="text-align: left;" class="w10 c2">'
								+		''+ data[index].advantage +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c3">@Resources.Defect：</td>'
								+	'<td style="text-align: left;" class="w10 c4">'
								+		''+ data[index].defect +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c1">@Resources.Other（@Resources.AuthorCantSee）：</td>'
								+	'<td style="text-align: left;" class="w10 c2">'
								+		''+ data[index].others +''
								+	'</td>'
								+'</tr>'
								+'</table>';

							$("#review_result").append(html);

							if (data[index].result == "@ConstValues.ContributationStatus.录用") {
								AcceptCount = AcceptCount + 1;
							} else if (data[index].result == "@ConstValues.ContributationStatus.不录用") {
								RejectCount = RejectCount + 1;
							}
						}

						$("#sysReviewResult").html("");
						if (AcceptCount == 0 && RejectCount == 0) {
							$("#sysReviewResult").append("@Resources.StatusReadyToReview");
						} else {
							if (AcceptCount > RejectCount) {
								$("#sysReviewResult").append("@Resources.StatusReviewAccept");
							} else if (AcceptCount <= RejectCount) {
								$("#sysReviewResult").append("@Resources.StatusReviewReject");
							}
						}
					}
				});
			}
		});

		$("#finalReview").window("open");
	}

	function lookupReview(id) {
		$("#l-review_result").html("");
		$("#l-sysReviewResult").html("");
		$("#l-finalReviewResult").html("");
		$("#l-finalRemark").html("");
		$("#l-abstractFile").html("");
		$("#l-supplementaryFile").html("");

		$("span[id='l-contributionId']").html("");
		$("span[id='l-title']").html("");
		$("span[id='l-author']").html("");
		$("span[id='l-affiliation']").html("");
		$("span[id='l-abstract']").html("");
		$("span[id='l-keyword']").html("");
		$("span[id='l-topicName']").html("");
		$("span[id='l-essayTypeName']").html("");
		$("span[id='l-reportType']").html("");
		$("span[id='l-programAbstract']").html("");
		$("span[id='l-awards']").html("");
		$("span[id='l-remark']").html("");

		var url = "@Url.Action(nameof(UtilityController.GetContributeInfo),
				nameof(UtilityController).GetControllerName())" + "/" + id;
		$.get(url, null, function (data, textStatus, jqXHR) {
			if (data.result == "@ConstValues.AjaxFailResult") {
				common.showError(data.message);
			} else {
				$("#l-hdnWindowType").val("final");
				$("#l-hidID").val(id);
				$("#l-hidContributeId").val(data.data.contributeId);

				$("span[id='l-contributionId']").html(data.data.contributeId);
				$("span[id='l-title']").html(data.data.essayTitle);
				$("span[id='l-author']").html(data.data.author);
				$("span[id='l-affiliation']").html(data.data.affiliation);
				var abs = "";
				if (data.data.abstract != null) {
					var reg = new RegExp("<p>","g");
					var reg2 = new RegExp("</p>","g");
					abs = data.data.abstract.replace(reg,"");
					abs = abs.replace(reg2,"");
				}
				$("span[id='l-abstract']").html(abs);
				$("span[id='l-keyword']").html(data.data.keyword);
				$("span[id='l-topicName']").html(data.data.topicName);
				$("span[id='l-essayTypeName']").html(data.data.essayTypeName);
				$("span[id='l-reportType']").html(data.data.reportType);
				$("span[id='l-programAbstract']").html(data.data.programAbstract);
				$("span[id='l-awards']").html(data.data.awards);
				$("span[id='l-remark']").html(data.data.remark);

				if (data.data.abstractFile != null) {
					if (/\.(pdf|PDF)$/.test(data.data.abstractFile)) {
						$("#l-abstractFile").append('<a class="downloadLink" href="'+data.data.abstractFilePath+'" target="_blank">'+data.data.abstractFile+'</a>');
					} else {
						$("#l-abstractFile").append('<a class="downloadLink" href="@Url.Action(nameof(UtilityController.DownloadContributeFile),
								nameof(UtilityController).GetControllerName())/'+data.data.contributeId+'/@ConstValues.FileType.Abstract">'+data.data.abstractFile+'</a>');
					}
				}
				if (data.data.supplementaryFile != null) {
					if (/\.(pdf|PDF)$/.test(data.data.supplementaryFile)) {
						$("#l-supplementaryFile").append('<a class="downloadLink" href="'+data.data.supplementaryFilePath+'" target="_blank">'+data.data.supplementaryFile+'</a>');
					} else {
						$("#l-supplementaryFile").append('<a class="downloadLink" href="@Url.Action(nameof(UtilityController.DownloadContributeFile),
								nameof(UtilityController).GetControllerName())/'+data.data.contributeId+'/@ConstValues.FileType.Supplementary">'+data.data.supplementaryFile+'</a>');
					}
				}

				if (data.data.contributationStatus == "@ConstValues.ContributationStatus.录用") {
					$("#l-finalReviewResult").append("@Resources.StatusReviewAccept");
				} else if (data.data.contributationStatus == "@ConstValues.ContributationStatus.不录用") {
					$("#l-finalReviewResult").append("@Resources.StatusReviewReject");
				} else if (data.data.contributationStatus == "@ConstValues.ContributationStatus.审核中") {
					$("#l-finalReviewResult").append("@Resources.StatusReviewing");
				} else {
					$("#l-finalReviewResult").append("@Resources.StatusReadyToReview");
				}

				@if (Model.IsReview) {
					<text>
				$("#l-finalRemark").append(data.data.advantage);
				</text>
				}

				$("#l-sysReviewResult").append("@Resources.StatusReadyToReview")
				var urlr = "@Url.Action(nameof(UtilityController.GetJuniorResult),
						nameof(UtilityController).GetControllerName())?id="+ id + "&userId=@((User as ICISPrincipal).UserID)";
				$.get(urlr, null, function (data, textStatus, jqXHR) {
					if (data.length > 0) {
						var AcceptCount = 0
						var RejectCount = 0
						for (var index = 0; index < data.length; index++) {
							var quality = "";
							if (data[index].quality == 1) {
								quality = "@ConstValues.ReviewQuality.One";
							} else if (data[index].quality == 2) {
								quality = "@ConstValues.ReviewQuality.Two";
							} else if (data[index].quality == 3) {
								quality = "@ConstValues.ReviewQuality.Three";
							} else if (data[index].quality == 4) {
								quality = "@ConstValues.ReviewQuality.Four";
							} else if (data[index].quality == 5) {
								quality = "@ConstValues.ReviewQuality.Five";
							} else if (data[index].quality == 6) {
								quality = "@ConstValues.ReviewQuality.Six";
							}

							var contributationStatus = "";
							if (data[index].result == "@ConstValues.ContributationStatus.待审") {
								contributationStatus += "@Resources.StatusReadyToReview";
							} else if (data[index].result == "@ConstValues.ContributationStatus.录用") {
								contributationStatus += "@Resources.StatusReviewAccept";
							} else if (data[index].result == "@ConstValues.ContributationStatus.不录用") {
								contributationStatus += "@Resources.StatusReviewReject";
							} else if (data[index].result == "@ConstValues.ContributationStatus.审核中") {
								contributationStatus += "@Resources.StatusReviewing";
							}

							var html = '<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c1">@Resources.ReviewId：</td>'
								+	'<td style="text-align: left;" class="w10 c2">'
								+		''+ data[index].userName +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c3">Quailty：</td>'
								+	'<td style="text-align: left;" class="w10 c4">'
								+		''+ (quality != 0 ? quality  : "") +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c1">Rating：</td>'
								+	'<td style="text-align: left;" class="w10 c2">'
								+		''+ (data[index].evaluation != 0 ? data[index].evaluation : "") +' '+data[index].remark +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c3">Recommendation：</td>'
								+	'<td style="text-align: left;" class="w10 c4">' + contributationStatus
								+ 	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c1">@Resources.Advantage：</td>'
								+	'<td style="text-align: left;" class="w10 c2">'
								+		''+ data[index].advantage +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c3">@Resources.Defect：</td>'
								+	'<td style="text-align: left;" class="w10 c4">'
								+		''+ data[index].defect +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c1">@Resources.ReviewerComment：</td>'
								+	'<td style="text-align: left;" class="w10 c2">'
								+		''+ data[index].advantage +''
								+              '\r\n'
								+		''+ data[index].defect +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c3">@Resources.Other（@Resources.AuthorCantSee）：</td>'
								+	'<td style="text-align: left;" class="w10 c4">'
								+		''+ data[index].others +''
								+	'</td>'
								+'</tr>'
								+'</table>';

							$("#l-review_result").append(html);

							if (data[index].result == "@ConstValues.ContributationStatus.录用") {
								AcceptCount = AcceptCount + 1;
							} else if (data[index].result == "@ConstValues.ContributationStatus.不录用") {
								RejectCount = RejectCount + 1;
							}
						}

						$("#l-sysReviewResult").html("");
						if (AcceptCount == 0 && RejectCount == 0) {
							$("#l-sysReviewResult").append("@Resources.StatusReadyToReview");
						} else {
							if (AcceptCount > RejectCount) {
								$("#l-sysReviewResult").append("@Resources.StatusReviewAccept");
							} else if(AcceptCount <= RejectCount) {
								$("#l-sysReviewResult").append("@Resources.StatusReviewReject");
							}
						}
					}
				});
			}
		});

		$("#lookupReview").window("open");
	}

	function sendConfirm(id, contributeId, conferenceId) {
		$("#sendId").val(id)
		$("#sendContributeId").val(contributeId)
		$("#sendConferenceId").val(conferenceId)
		var conferenceLanguage = "@ViewBag.Language";
		if (conferenceLanguage  == "@ConstValues.Language.En") {
			$("#sendWindow").window({
				width:800,
				left: ($(window).width() - 800) * 0.5
			})
		} else {
			$("#sendWindow").window({
				width:600,
				left: ($(window).width() - 600) * 0.5
			})
		}
		$("#sendWindow").window("open");
	}

	function send(hasPdf) {
		var id =$("#sendId").val()
		var contributeId =$("#sendContributeId").val()
		var conferenceId =$("#sendConferenceId").val()

		var confirmMessage = "@Resources.CfmSendReviewResult";
		$.messager.confirm("@Resources.Send", confirmMessage, function (r) {
			if (r) {
				$("#l-hidID").val(id);
				$("#l-hidContributeId").val(contributeId);
				$("#l-hidConferenceId").val(conferenceId);
				$("#l-hasPdf").val(hasPdf);
				$.post("@Url.Action(nameof(ConferenceReviewController.SendMail),
						nameof(ConferenceReviewController).GetControllerName())",
					$("#lookupJudge").serialize(),
					function(data, textStatus, jqXHR) {
						if (data.result == "@ConstValues.AjaxFailResult") {
							common.showError(data.message);
						} else {
							common.showSuccess(data.message, true);
							setTimeout(function () {
								$("#dataGrid").datagrid("reload");
							}, 2000);
						}
					}
				);
			}
		});
	}

	function saveFinal() {
		var finalResult = $("input[name='finalResult']:checked").val();
		if (finalResult == null) {
			common.showError("@Resources.MsgReviewResultError");
			return;
		}

		$.messager.confirm("@Resources.Save", "@Resources.CfmSave", function (r) {
			if (r) {
				var loading = layer.load(0,  {
					shade: [0.4,"#fff"]
				});
				$.post("@Url.Action(nameof(ConferenceReviewController.FinalReview),
						nameof(ConferenceReviewController).GetControllerName())",
					$("#finalJudge").serialize(),
					function(data, textStatus, jqXHR) {
						layer.close(loading);
						if (data.result == "@ConstValues.AjaxFailResult") {
							common.showError(data.message);
						} else {
							common.showSuccess(data.message, true);
							$("#finalReview").window("close");
							$("#dataGrid").datagrid("reload");
						}
					}
				);
			}
		});
	}

	function searchData() {
		$("#hdnIds").val("");
		$("#dataGrid").datagrid("load", {
			SelTopic: $("#selTopic").combobox("getValue"),
			SelReport: $("#selReport").combobox("getValue"),
			SelEssay: $("#selEssay").combobox("getValue"),
			ContributeStatus: $("#selContributionStatus").combobox("getValue"),
			HasSend: $("#selSendStatus").combobox("getValue"),
			SelfReview: $("#selSelfReview").combobox("getValue"),
			SelIdName: $("#selIdName").textbox("getValue"),
		});
	}

	function exportData(){
		var exportIdList = $("#hdnIds").val();
		if (exportIdList == "") {
			$.messager.alert("@Resources.Export", "@Resources.MsgRecordMust", "warning");
			return;
		}

		$("#hdnIds").val(exportIdList);
		$("#hidExtConferenceId").val("@Model.ConferenceId");
		$("#frmExport").submit();
	}

	function openAuthor(id) {
		$("#authorDG").datagrid({
			url: "@Url.Action(nameof(UtilityController.GetAuthorList),
					nameof(UtilityController).GetControllerName())",
			method: "get",
			checkOnSelect: false,
			selectOnCheck: false,
			height: 532,
			nowrap: false,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			singleSelect: true,
			singleCheck: true,
			frozenColumns: [[
				{ field: "sort", title: "@Resources.Sort", align: "center", width: 50 },
				{
					field: "fullName", title: "@Resources.FullName", align: "center", width: 200,
					formatter: function(value, rec) {
						if (null != value && "" != value) {
							return value;
						} else {
							return rec.familyName + " " + rec.firstName
						}
					}
				},
				{ field: "mail", title: "@Resources.Mail", align: "center", width: 250 },
			]],
			columns: [[
				{ field: "affiliation", title: "@Resources.Affiliation", align: "center", width: 200 },
				{ field: "department", title: "@Resources.Department", align: "center", width: 100 },
				{
					field: "status", title: "@Resources.Status", align: "center", width: 100,
					formatter: function(value, rec) {
						if (value=="@ConstValues.Status.正常") {
							return "@Resources.Normal"
						} else {
							return "@Resources.Pause"
						}
					}
				},
				{
					field: "isContactAuthor", title: "@Resources.ContactAuthor", align: "center", width: 150,
					formatter: function(value, rec) {
						var strInfo = "";
						if (rec.isContactAuthor == true) {
							strInfo = "<input type='checkbox' style='margin-top:8px;' disabled='false' checked/>";
						} else {
							strInfo = "<input type='checkbox' style='margin-top:8px;' disabled='false' />";
						}
						return strInfo;
					}
				},
				{
					field: "isPresenter", title: "@Resources.Presenter", align: "center", width: 100,
					formatter: function(value, rec) {
						var strInfo = "";
						if (rec.isPresenter == true) {
							strInfo = "<input type='checkbox' style='margin-top:8px;' disabled='false' checked/>";
						} else {
							strInfo = "<input type='checkbox' style='margin-top:8px;' disabled='false' />";
						}
						return strInfo;
					}
				},
				{ field: "remark", title: "@Resources.Remark", align: "center",  width: 200 },
				{ field: "familyName", hidden: true },
				{ field: "firstName", hidden: true },
				{ field: "country", hidden: true },
				{ field: "state", hidden: true },
				{ field: "city", hidden: true },
				{ field: "address", hidden: true },
				{ field: "zipCode", hidden: true },
				{ field: "mobile", hidden: true },
				{ field: "ccMail", hidden: true },
				{ field: "selfIntroduction", hidden: true },
			]],
			onBeforeLoad: function(param) {
				param.id = id;
				param.random = Math.random();
			},
		});
		$("#authorWindow").window("open");
	}

	function openAdmin(contributeId, contributationStatus, adminStatus, adminRemark) {
		$("#hidAdminContributeId").val(contributeId);
		if (contributationStatus == "@ConstValues.ContributationStatus.录用")
		{
			$("span[id='reviewerResult']").html("@Resources.StatusReviewAccept");
		}
		else if (contributationStatus == "@ConstValues.ContributationStatus.不录用")
		{
			$("span[id='reviewerResult']").html("@Resources.StatusReviewReject");
		}
		$("#ddlAdminResult").combobox("setValue", adminStatus != "null" ? adminStatus : "");
		$("#txtAdminRemark").textbox("setValue", adminRemark != "null" ? adminRemark : "");
		$("#adminWindow").window("open");
	}

	function saveAdmin() {
		var isValid = $("#frmAdmin").form("validate");

		if (isValid) {
			$.messager.confirm("@Resources.Save", "@Resources.CfmSave", function (r) {
				if (r) {
					$("#frmAdmin").form({
						iframe: false,
						success: function (data) { }
					});

					var loading = layer.load(0,  {
						shade: [0.4,"#fff"]
					});

					$("#frmAdmin").form("submit", {
						url: "@Url.Action(nameof(ConferenceReviewController.AdminModify), nameof(ConferenceReviewController).GetControllerName())",
						onSubmit: function (param) {
							param.random = Math.random();
						},
						success: function (data) {
							data = JSON.parse(data);
							layer.close(loading);
							if (data.result == "@ConstValues.AjaxFailResult") {
								common.showError(data.message);
							} else {
								common.showSuccess(data.message, true);
								$("#adminWindow").window("close");
								$("#dataGrid").datagrid("reload");
							}
						},
					});
				}
			});
		}
	}
</script>
}